<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Music Store 管理员界面</title>
<link type="text/css" rel="Stylesheet" href="style/admin.css" />
<style type="text/css">
#albumEdit {
	margin: 0 0 0 40px;
	line-height: 2;
}

#albumEdit input.txt, #albumEdit select, #albumEdit textarea.txt {
	width: 200px;
}

.a_bg:hover {
	background-color: #F8E281;
}

table {
	background-color: #F5F5F5;
	margin-left: 50px;
}
</style>
</head>

<body>
	<div id="wrapper">
		<div id="header">
			<div id="header-logo">
				<a href="#"><img src="style/images/logo.png" alt=""></img></a>
			</div>
			<div id="header-nav">
				<h3>后台功能</h3>
				<ul>
					<li><a class="a_bg" href="albumlist">商品管理</a></li>
					<li><a class="a_bg" href="#">用户管理</a></li>
				</ul>
			</div>
		</div>
		<div id="content">
			<div id="content-title">
				<h3>商品管理</h3>
			</div>
			<div id="content-main">
				<form action="albumlist" method="get">
					分类: <select name="gid">
						<option value="0">所有分类</option>
						<c:forEach var="g" items="${genres}">
							<c:if test="${g.id==param.gid}">
								<option value="${g.id}" selected="selected">${g.name}</option>
							</c:if>
							<c:if test="${g.id!=param.gid}">
								<option value="${g.id}">${g.name}</option>
							</c:if>
						</c:forEach>
					</select> 标题: <input type="text" name="title" value="${title}" /> <input
						type="submit" /> <a href="albumAdd">添加新电影</a>
				</form>
				<hr />
				<table border="1" rules="all" bordercolor="#ffffff" width="800px">
					<tr>
						<td style="text-align: center">唱片名称</td>
						<td style="text-align: center">歌手</td>
						<td style="text-align: center">单价</td>
						<td style="text-align: center">编辑</td>
						<td style="text-align: center">海报</td>
					</tr>
					<c:forEach var="album" items="${albums }">
						<tr>
							<td style="text-align: center">${album.title }</td>
							<td style="text-align: center">${album.artist }</td>
							<td style="text-align: center">${album.price }</td>
							<td style="text-align: center"><a
								href="albumUpdate?id=${album.id}">编辑</a></td>
							<td style="text-align: center"><a
								href="download?filename=${album.id }.jpg">下载</a></td>
						</tr>
					</c:forEach>
					<tr>
						<td><a href="download?CoverImages/${album.id }.txt">文本文件</a>
							<a href="download?filename=${album.id }.xlsx">Exce文件</a></td>
						<td colspan="4" style="text-align: right;"><c:if
								test="${totalPages>0}">
								<c:if test="${page>1}">
									<a href="?page=${page-1}&gid=${param.gid}&title=${param.title}">[上一页]</a>
								</c:if>
								<c:if test="${page<=1}">
									<a>[上一页]</a>
								</c:if>
								<c:if test="${page<totalPages}">
									<a href="?page=${page+1}&gid=${param.gid}&title=${param.title}">[下一页]</a>
								</c:if>
								<c:if test="${page>=totalPages}">
									<a>[下一页]</a>
								</c:if>
								第 ${page} 页，共 ${totalPages} 页
							</c:if></td>
					</tr>
				</table>
			</div>
		</div>
		<div id="footer">
			<div id="footer-contactUs">
				<p>Sams Music Store</p>
				<p>Design by Sam Chen, July,2011.</p>
			</div>
		</div>
	</div>
</body>
</html>